package com.tree.backend.controller;

import com.tree.backend.common.Result;
import com.tree.backend.entity.vo.CustomerAnalysisVO;
import com.tree.backend.entity.vo.EquipmentAnalysisVO;
import com.tree.backend.service.IAnalysisService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 数据分析控制器
 */
@RestController
@RequiredArgsConstructor
@RequestMapping("/analysis")
public class AnalysisController {

    private final IAnalysisService analysisService;

    @GetMapping("/customer")
    public Result<CustomerAnalysisVO> analysis() {
        return Result.success(analysisService.getCustomerAnalysisData());
    }

    @GetMapping("/equipment")
    public Result<EquipmentAnalysisVO> equipmentAnalysis() {
        return Result.success(analysisService.getEquipmentAnalysisData());
    }
}